package org.budo.jdbc.dao.statement.named;

import java.util.HashMap;
import java.util.Map;

/**
 * @author lmw
 */
public class NamedParameterQuery {
    private String sourceSql;

    private String parsedSql;

    private Map<String, Integer> parameterIndex = new HashMap<String, Integer>();

    public NamedParameterQuery() {}

    public NamedParameterQuery(String sourceSql, String parsedSql, Map<String, Integer> parameterIndex) {
        this.sourceSql = sourceSql;
        this.parsedSql = parsedSql;
        this.parameterIndex = parameterIndex;
    }

    public String getParsedSql() {
        return this.parsedSql;
    }

    public Integer getParameterIndex(String key) {
        return this.parameterIndex.get(key);
    }

    @Override
    public String toString() {
        return super.toString() + ", sourceSql=" + sourceSql + ", parsedSql=" + parsedSql + ", parameterIndex=" + parameterIndex;
    }
}